//
//  AppDelegate.m
//  shusheng
//
//  Created by rimi on 16/7/9.
//  Copyright © 2016年 yuying. All rights reserved.
//

#import "AppDelegate.h"
#import "CDCacheManager.h"
#import "CDChatManager.h"
#import "CDIMService.h"
#import <AVOSCloudCrashReporting/AVOSCloudCrashReporting.h>
#import "LoginViewController.h"
#import "CYLTabBarControllerConfig.h"

#import "iflyMSC/IFlyMSC.h"
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    //声音
    NSString *initString = [[NSString alloc] initWithFormat:@"appid=%@",@"578362f0"];
    [IFlySpeechUtility createUtility:initString];

    
    
    [self setSettings];
    //    [AVOSCloud setApplicationId:@"lHdTkHPgMNJLxV7HsA5MIR5C-gzGzoHsz"
    //                      clientKey:@"CcPb4va7aOsGTtxMgsCWUKBw"];
    [AVAnalytics trackAppOpenedWithLaunchOptions:launchOptions];

    
    self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
    self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"main.jpeg"]];
    LoginViewController * rootVc = [[LoginViewController alloc]init];
    _window.rootViewController = rootVc;
    [self.window makeKeyAndVisible];
    
    return YES;
}
- (void)setSettings{
    [CDAddRequest registerSubclass];
    [CDAbuseReport registerSubclass];
    // Enable Crash Reporting
    [AVOSCloudCrashReporting enable];
    //希望能提供更详细的日志信息，打开日志的方式是在 AVOSCloud 初始化语句之后加上下面这句：
    [AVOSCloud setAllLogsEnabled:YES];
    [AVOSCloud setApplicationId:@"lHdTkHPgMNJLxV7HsA5MIR5C-gzGzoHsz" clientKey:@"CcPb4va7aOsGTtxMgsCWUKBw"];
    [AVOSCloud setLastModifyEnabled:YES];
}

- (void)toLogin{}

-(void)toMain{}
- (void)applicationWillResignActive:(UIApplication *)application {
    
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application {
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
